AEInteractWithUser
AEInteractWithUser Interact with user
#include <AppleEvents.h> Apple Event Manager
OSErr AEInteractWithUser( timeOutInTicks, nmReqPtr, idleProc );
long timeOutinTicks ; time to wait for user response
NMRecPtr nmReqPtr ; pointer to Notification Manager record
IdleProcPtr idleProc ; pointer to your idle function
returns Error Code; 0 = no error
You can use the AEInteractWithUser function to initiate interaction with
the user when your application is a server application responding to an Apple
event.
The timeOutInTicks parameter is the amount of time (in ticks) that your
handler is willing to wait for a response from the user.
The nmReqPtr parameter is a pointer to a Notification Manager record
provided by your application. You can specify NIL for this parameter to get the
default notification handling provided by the Apple Event Manager.
The idleProc parameter is a pointer to your application's idle function, which
handles events while waiting for the Apple Event Manager to return
control.
The AEInteractWithUser function checks to see if the client application set
the kAENeverInteract flag for the Apple event and, if so, returns an error. If
not, then the AEInteractWithUser function checks the server application's
preference set by the AESetInteractionAllowed function and compares it
against the source of the Apple event-that is, whether it came from the same
application, another application or process on the same computer, or an
application or process running on another computer.
AEInteractWithUser returns the errAENoUserInteraction result code if
the user-interaction preferences don't allow user interaction. If user
interaction is allowed, the Apple Event Manager brings your application to
the front, either directly or by posting a notification request. If
AEInteractWithUser returns the noErr result code, then your application
is in the foreground and is free to interact with the user.
For a program example showing usage of this routine, see the description of
Create Publisher Event.
Result codes
noErr (0) No error
errAETimeout (-1712) Apple event timed out
errAENoUserInteraction (-1713) No user interaction allowed